<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function fn() {
            /*var n = navigator.appCodeName;   //获取浏览器代码名*/
            /*var n = navigator.appName;  //获取浏览器名*/
            /*var n = navigator.appVersion; //获取版本号及平台信息*/
            var n = navigator.userAgent;  //获取浏览器信息

            alert(n);
        }
    </script>
</head>
<body>
<input type="button" value="点击" onclick="fn()">
</body>
</html>